<?php
  include('./library/conn.php');
   // 接受一个id
  $id = $_REQUEST['id'];
  // $id=10004;

  $sql = "select * from product";

    $res = $conn->query($sql);

    $conn->close();

    $arr = array();

    while($row = $res->fetch_assoc()){
        array_push($arr,$row);
    }

    $json = json_encode($arr);

    echo $json;
?>